<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="css/ui-base.css">
<link rel="stylesheet" href="css/ui-box.css">
<link rel="stylesheet" href="css/project/style.css">
<link rel="stylesheet" href="css/zv_common.css">
 <script src="js/zy_control.js"></script>
<script src="js/zy_click.js"></script>
<script src="js/zy_json.js"></script>
<script src="js/main.js"></script>
<script src="js/init.js"></script>
<script type="text/javascript" src="js/JsonSQL/jsonsql-0.1.js"></script>
<script src="js/talkingdata.js"></script>
<style type="text/css">
.zvattenr{ margin-right:0.5em; text-align:right}
</style>
</head>
<body class="um-vp c-wh2" ontouchstart>
<div id="page_1" class="ub ub-ver um-vp">	
<div id="attendance_list" >
</div>    
</div>	  
</body>
<script>
zy_init();
window.uexOnload=function(type){
	
	attendance_list()
}
Loading(0);
function attendance_list(){	
IC.talkingDataCount("考勤管理","0018");
			 var strx = "";
			 var json = localStorage.getItem("zvData")
			 var jsona ='['+json+']';
			 var  obj = strToJson(jsona);
			 var objdata = obj[0].Result.DataTable;
			 var enl=objdata.length
			if(enl==undefined || enl=="undefined")
			{
				var stringObj=json  
				var zv_newstr=stringObj.replace('"DataTable":{"Rows":{','"DataTable":[{'); //字符替换 
				zv_newstr=zv_newstr.replace('}}}}','}]}}'); //字符替换 
				zv_newstr ='['+zv_newstr+']';
				zv_objdata = strToJson(zv_newstr);
				objdata = zv_objdata[0].Result.DataTable;
			}
			var z=0
			for(var i=0;i<objdata.length;i++)
			{
			
				if(i==0)
				{
					var roleName= objdata[i].roleName
					if(roleName=="" || roleName==" " || roleName=="undefined" ||  roleName==undefined)
					{
						roleName = "&nbsp;"
					}
				strx += '<div class="ulev0 ub-f1 uinn zv_h1 c-blu2">'+objdata[i].EmployeeName+'&nbsp;('+objdata[i].employeeNumber+')</div>'//头部	
				}
					var dateid= objdata[i].dateId
					if(dateid!="")
					{
						dateid = dateid.substring(0,10);//日期
					}
		
					
					var endDateTime= objdata[i].endDateTime
					if(endDateTime=="" || endDateTime==" " || endDateTime=="undefined" ||  endDateTime==undefined)//结束时间
					{
						endDateTime = "&nbsp;"
					}
					else
					{
					       endDateTime = endDateTime.substring(11,16);
						   endDateTime= endDateTime.replace("T"," ");
					}
					var startDateTime= objdata[i].startDateTime
					if(startDateTime=="" || startDateTime==" " || startDateTime=="undefined" ||   startDateTime==undefined)//开始时间
					{
						startDateTime = "&nbsp;"
					}
					else
					{
					       startDateTime = startDateTime.substring(11,16);
						   startDateTime= startDateTime.replace("T"," ");
					}
					var actualStartTime= objdata[i].actualStartTime
					if(actualStartTime=="" || actualStartTime==" " || actualStartTime=="undefined" ||   actualStartTime==undefined)//实际开始时间
					{
						actualStartTime = "&nbsp;"	
					}
					else
					{
//						actualStartTime= actualStartTime.replace("PT","");
//						actualStartTime= actualStartTime.replace("M","");
//						actualStartTime= actualStartTime.replace("H",":");
//						
						actualStartTime= actualStartTime.split(":"); 
						var actualStartTime_1=actualStartTime[0]
//						if(actualStartTime_1<10)
//						{
//							actualStartTime_1='0'+actualStartTime_1
//						}
//						if(actualStartTime_1==0)
//						{
//							actualStartTime_1='00'
//						}
						var actualStartTime_2=actualStartTime[1]
//						if(actualStartTime_2<10)
//						{
//							actualStartTime_2='0'+actualStartTime_2
//						}
//						if(actualStartTime_2==0)
//						{
//							actualStartTime_2='00'
//						}
						actualStartTime=actualStartTime_1+':'+actualStartTime_2
						
					}
					
					var actualEndTime= objdata[i].actualEndTime
					if(actualEndTime=="" || actualEndTime==" " || actualEndTime=="undefined" ||   actualEndTime==undefined)//实际结束时间
					{
						actualEndTime = "&nbsp;"
					}
					else
					{
//						actualEndTime= actualEndTime.replace("PT","");
//						actualEndTime= actualEndTime.replace("M","");
//						actualEndTime= actualEndTime.replace("H",":");
 					   actualEndTime= actualEndTime.split(":"); 
						var actualEndTime_1=actualEndTime[0]
//						if(actualEndTime_1<10)
//						{
//							actualEndTime_1='0'+actualEndTime_1
//						}
//						if(actualEndTime_1==0)
//						{
//							actualEndTime_1='00'
//						}
						var actualEndTime_2=actualEndTime[1]
//						if(actualEndTime_2<10)
//						{
//							actualEndTime_2='0'+actualEndTime_2
//						}
//						if(actualEndTime_2==0)
//						{
//							actualEndTime_2='00'
//						}
						actualEndTime=actualEndTime_1+':'+actualEndTime_2
					}
					var ActualWorkingHours= objdata[i].ActualWorkingHours
					if(ActualWorkingHours=="" || ActualWorkingHours==" " || ActualWorkingHours=="undefined" ||   ActualWorkingHours==undefined)//实际工作时间
					{
						ActualWorkingHours = "0"
					}
					else
					{
					   ActualWorkingHours =  Math.round(ActualWorkingHours*100)/100
					}
					
					var WorkingHours= objdata[i].WorkingHours
					if(WorkingHours=="" || WorkingHours==" " || WorkingHours=="undefined" ||   WorkingHours==undefined)//工作时间
					{
						WorkingHours = "0"
					}
					else
					{
					   WorkingHours =  Math.round(WorkingHours*100)/100
					}
					strx += '<div class="ub">'
	    			strx += '<div class="umw5 uinn" style="height:2.5em; line-height:1.25em; background:#eef2f6">'+dateid+'</br>'+roleName+'</div>'
	        		strx += '<div class="ub-f1 ub-ver" style="background-color:#dfe6ee; border-bottom:1px solid #fff">'
	        		strx += '<div class="ub ulev-1 zv_h1 ub-ac">'
					if(startDateTime=='&nbsp;'&&endDateTime=='&nbsp;')
					{
					
					strx += '<div class="ub-f1" style="margin-left:0.5em">计划：无排班</div>'		
					}
					else
					{
					strx += '<div class="ub-f1" style="margin-left:0.5em">计划：'+startDateTime+' - '+endDateTime+'</div>'	
					}
					
	                strx += '<div class="umw4 ub-pe zvattenr">'+WorkingHours+'小时</div>'
	            	strx += '</div>'
	            	strx += '<div class="ub ulev-1 zv_h1 ub-ac">'
					if(actualStartTime=='&nbsp;'&&actualEndTime=='&nbsp;')
					{
					strx += '<div class="ub-f1" style="margin-left:0.5em">实际：无上班</div>'		
					}
					else
					{
					strx += '<div class="ub-f1" style="margin-left:0.5em">实际：'+actualStartTime+' - '+actualEndTime+'</div>'
					}
	                strx += '<div class="umw4 ub-pe zvattenr">'+ActualWorkingHours+'小时</div>'
	            	strx += '</div>'
	        		strx += '</div>'
	    			strx += '</div>'
			}	
			$$("attendance_list").innerHTML=strx;
			Loading(-1);
}	
</script>
</html>
